//
//  HELCourseInformationCell.m
//  HandheldELearn
//
//  Created by wsj2015 on 16/8/2.
//  Copyright © 2016年 陈武琦. All rights reserved.
//

#import "HELCourseInformationCell.h"

@implementation HELCourseInformationCell

- (void)awakeFromNib {
    // Initialization code
    
    self.pdfBgView.layer.borderWidth = 4;
    self.pdfBgView.layer.borderColor =HexRGB_WSJ(221, 223, 224).CGColor;
    wsj_cornerRadius(self.examBtn, 6);
    
    UITapGestureRecognizer *tap =[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(play)];
    [self.pdfBgView addGestureRecognizer:tap];
    
}
- (void)play{
    if (self.playBlock) {
        self.playBlock();
    }
}
- (IBAction)examAction:(id)sender {
    if (self.examBlock) {
        self.examBlock();
    }
    
}
- (void)setModel:(HELCourseDetailModel *)mode{
//    self.sizeLabel.text = mode.sizeShow;
//    self.firstTag.hidden = YES;
//    self.secondTag.hidden = YES;
//    self.thirdTag.hidden = YES;
//    if (mode.keyword) {
//        self.firstTag.hidden = NO;
//        self.firstTag.text = mode.keyword;
//    }
    self.detailL.text = mode.detail;
    
    self.pdfnameLabel.text = [NSString stringWithFormat:@"%@.pdf",mode.name];
    if (mode.progress) {
        self.learnGrogress.text  =[NSString stringWithFormat:@"已学习:  %@%%",mode.progress];
    }else{
       self.learnGrogress.text  =[NSString stringWithFormat:@"未开始学习"];
    }

 
    if (mode.tblExamId ==nil ) {
       
        self.examBtn.hidden =YES;
    }else{
        if ([mode.progress isEqualToString:@"100"]) {
             self.examBtn.hidden =NO;
        }else{
         self.examBtn.hidden =YES;
        }
    }
    
}

@end
